package first; /**
 * @package PACKAGE_NAME
 * @author 刘辉
 * @date 2020/9/24 15:15
 * @param $
 */

import java.io.PrintWriter;
import java.net.Socket;
import java.util.Scanner;

/**
 * @ClassName clent
 * @Description TODO
 * @Author 14784
 * @Date 2020/9/24 15:15
 * @Version 1.0
 */
public class client {
    public static void main(String[] args) throws Exception {
        Socket client = new Socket("127.0.0.1",9091);

        try {
            PrintWriter output =
                    new PrintWriter(client.getOutputStream(), true);
            Scanner cin = new Scanner(System.in);
            String words;

            while (cin.hasNext()) {
                words = cin.nextLine();

                output.println(words);

                System.out.println("写出了数据: " + words);
            }

            cin.close();
        } finally {
            client.close();
        }
    }
}
